I’m not sure what else you could try as this isn’t a situation I’ve been in. All I can say is that error strongly implies your build environment is broken somehow. Are you able to build Emacs 26?