Patch `configure` on windows to use mthread instead of pthread

The necessity of this patch seems to depend on which version of mingw you're using, see inline comment.