Update old build script with validate.c file
Updated header files following #751
Also supporting C89 compiler.