Set GCC-specific flags before most configure checks.

This fixes detection of isfinite() and other C99 functions in Solaris 10
and other platforms.
Remove AM_PROG_CC_C_O, deprecated since automake 1.14.