cmake: link pthreads libraries

 - fix build error on Archlinux
 - re #740