If you have vcpkg installed, then you can just do:
vcpkg.exe install pthread
That will download some code from https://sourceforge.net/projects/pthreads4w, compile it and install it in your system. If vcpkg is setup correctly on your machine, Visual Studio should use these files automatically.