fix pthread flag

the correct flag is -lpthread, not -pthread. Also, use it only on
windows, the only place where it is necessary
Merge pull request #2 from duthils/windows-pthread

fix pthread flag