diff --git a/Makefile b/Makefile
index 86035d866f2c..c9199ca3a8b0 100644
--- a/Makefile
+++ b/Makefile
@@ -1804,7 +1804,7 @@ existing-targets := $(wildcard $(sort $(targets)))
 
 -include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
 
-endif # config-targets
+endif # config-build
 endif # mixed-build
 endif # need-sub-make