I found that in order to compile STP on 10.5, I need to change the following in Makefile.common:
# in order to build a binary that will link against the 10.4u SDK
# and run on the 10.4 system.
MACOSX_MIN = -mmacosx-version-min=10.4
# add MACOSX_MIN
CFLAGS_BASE = -O2 $(MACOSX_MIN) $(OPTIONS1) $(OPTIONS2)
LDFLAGS_BASE = -lstdc++ $(MACOSX_MIN)
Another solution may be found below but I haven't tried.