Why is this necessary? It's much more elegant to default to BUILD=release and allow overriding with BUILD=debug. Submakes should only be executed when really necessary.