The build was broken because the pre-build target didn't pass a proper environment to 'gmake depends'.