Running make with the flag `-j` uses all available cores, but this sometimes causes threads to thrash or other bad things to happen.

***In a bash script, how can I use `n-1` cores instead (only if `n>1` otherwise 1).*** 

There must be a simpler way to do it than this:

```
NJOBS=$((`getconf _NPROCESSORS_ONLN 2>/dev/null \
   || sysctl hw.ncpu  \
   || echo 2` \
   - 1))

```