Fix portability nits

Also set a language standard for the GNUMakefile build and separate
CFLAGS and CXXFLAGS.