Fix Solaris thread dependency by using pthreads