Do you really need link in librt, libjack and libasound?
No, I just copied some of the makefile stuff from the pd/src directory
the makefile you want to "copy" is in /externals/build/linux/ there are similar ones in mac and win , just replace the "ls ../src" up top with a list of your .c files...then if it doesnt work it can proably be narrowed down to your code rather than the makefile...just test it on something else say abs~.c first...
,x