Only link against libpthread if required (will be detected by configure).
Simplify call to configure.