Made pthread usage optional (but not autodetected)