Add a NUM_CPUS env var to builds

Closes #539