Use the -static switch on MinGW to prevent dependency on an external libpthread.dll on some MinGW distributions.