Update Makefile with CI infrastructure changes

The CI scripts do a few hacks to our Makefile so it works better for them.
Bring in those changes, and also cut down the number of packages we install
by omitting build-essential and using the --no-install-recommends flag.
Looks like it's turning the newlines into single spaces for the benefit of the command:

<https://www.gnu.org/software/make/manual/html_node/Text-Functions.html#index-stripping-whitespace-579>