Only set -pthread for cc compiler.