Needed to change LIBS = $(SDLLIB) $(AGARLIB) to LIBS = $(AGARLIB) $(SDLLIB) to get link phase to work