Relocated mingw fixup code to config.hpp and made sure that gets included first.