improved handling of mingw dlls