Add missing thread library for test.

Debian wheezy copes without, sid & FreeBSD don't.