Fix portability nits

Also set a language standard for the GNUMakefile build and separate
CFLAGS and CXXFLAGS.
Why are you doing this?  Is that just to return a negative ``int`` on errors rather than an errnum?