Fix building with mingw

Specifically:
-Only use ms specific compiler flags when using msvc
-remove duplicate include dirs
-always define HAVE_CONFIG since it's generated from cmake