Use fewer threads for g++ to conserve memory.