Link pthread for tests