Reinstate code removed that allows building with mingw and the pthreads-win32 library

Newer versions of mingw-w64 can be built with an included pthread implementation
called winpthreads which uses an integer type for pthread_t but pthreads-win32 does
not.
Use COMPILER_MINGW define rather than __MINGW64__

This is necessary to build with win32 target using mingw-w64 version
on Fedora 19