Modified cmake files to add pthread as a linked lib for linux