Fixing build for x86_64-w64-mingw32

As discussed, these changes allow the build to succeed on 64 bit windows using mingw64 gcc.