Revert "Revert "Makefile: refactor environment check""
Revert "Revert "Makefile: refactor environment check""

This reverts commit 10b370f6076d4150139fddb9dc81c9fd80207b91.

alphagov/paas-cf,alphagov/paas-cf,alphagov/paas-cf,alphagov/paas-cf,alphagov/paas-cf,alphagov/paas-cf,alphagov/paas-cf,alphagov/paas-cf