Change -lpthread to -pthread and add clang