When compiling under mingw it was using the w32-pthreads instead of the shared mingw pthread library.