explicitly link in pthread on Linux/MacOSX

fix the pthread issue from #18