Mingw updates

Mostly fixes to be able to build with mingw again on Fedora 19 and 20