The formatting in your question (both the makefile and the error message) is too confusing, but I suspect your ifeq is indented with tabs.
This is not true; ifeq - make command. (Almost) all lines with TAB characters when the first character in a line in a makefile is passed to the shell. The shell knows nothing about ifeq , so, depending on your shell, it might print such an error.
You have to move the target app: after the ifeq blocks just before using $(CC) (and make sure the line $(CC) ... is indented with a tab as the first character on that line).
In the future, please remember to use the SO formatting capabilities and remember to cut and paste error messages accurately, plus a few lines of context before and after, asking questions.
MadScientist
source share