Link tests against threading lib.
Merge pull request #23 from schneith/fix/pthread

Link tests against threading lib.