mingw-w64 provides its own pthreads library. Also, change link libs as mingw-w64 libraries are not postfixed .lib