Add mingw32 support

With these changes, on Ubuntu I can do:

./configure --host=i586-mingw32msvc  && make
5 files changed