use -pthread if it works

This should help with failures like this:

http://www.cpantesters.org/cpan/report/85318264-6c09-1014-a156-cfe145601f20

where -pthread is not reqcognized by the c compiler.