At least on gcc 4.6 the test target needs to link against pthread