Optimize build script.
Merge pull request #251 from Alexpux/mingw-w64-builds

Optimize build script.