Use -pthread for Linux