Default to building with pthreads.  Also, declare pthread stubs as weak symbols, except on Windows.
This should prevent us from stomping on pthreads symbols when linked into
programs that use pthreads.