notice that all indention is mode with [tabs]

Standart rule

main.bin: main.c lib.c2
    gcc -o main.bin main.c lib.c

conditional

checking the value of a variable

ifeq ($(PLATFORM),Linux)
    CMD = ls -lh
else
    CMD = dir
endif

For just checking eistence of a variable use ifdef and ifndef

ifdef VARNAME
    do something
endif