Add pthread support.