Explicitly add -lpthread for Ubuntu