Use CMAKE_C_FLAGS variable to set compiler flags.

If the compiler is some GNU-alike variant, set the compiler flags to use
the gnu99 dialect of C and enable all warnings.

Non-GNU compilers may have to have their own magic added to set dialect
and enable warnings.

Closes #179.