Simplifying the num_cores logic in build.sh