cmake: Fix build on gcc

Clang recognizes "-Werror=incompatible-pointer-types" but not GCC. So if
on GCC, don't add it to CFLAGS.