
Going back to getting the build to work "naturally", I think the next step would be to edit energy.h and change line 19 to "# define isFinite(x) isfinite(x)", i.e. add "is" before finite.
The good news is that I tried building myself with CFLAGS=-std=c99 in an attempt to reproduce your errors, and this was the last change I had to make to get a clean build!
(If this works, maybe I'll add another source download for M1 Macs and anything else that needs more modern C.)