More improvements for cygwin and mingw32 building