Add check for pthread linker dependency