Ensure that -lpthread is statically linked under MinGW.