Add detection of pthread library name