Detect if the compiler supports -pthread.