Add -lpthread when linking unit tests.

Fixes #8