Improved check for GCC's -pthread and -pthreads flag
Enable TSRM to use Pth
Improve Pthreads check
Move config code into separate file
12