Better support for building with mingw64; thanks to Nicolas Roche @ Altran for the fix.