Reorder program checks in configure.ac.

Add an explicit check for AC_PROG_CC before checking for C99 mode and
move the macros under the correct heading.