DBFLAGS = -g -Wall
COMP    = gcc $(DBFLAGS) -c $< -o $@

# -----------------------------
# Change 'myprog' to the name of your program (two places).
# Change 'main' to the name of your source file (three places).

OBS     = main.o

myprog : $(OBS)
	gcc $(DBFLAGS) -o myprog $(OBS)

# -----------------------------

main.o : main.c
	$(COMP)


Download this Makefile
Right-click on the link above, then select "save link as ..."