[quote] How to determine what target is given in Makefile from the make command-line?

Yes, you could get the target that is given from the make command-line by using MAKECMDGOALS

for example below,

ifneq "$(MAKECMDGOALS)" "clean"
-include config.mk
endif

that is when using  make clean in command-line, config.mk will not be included.

otherwise, like "make" will make config.mk be included.