adding detection of pthread library.