It looks like the debian package just patches that bit of the makefile out. =)
You should probably just do the same. Though I imagine that's what got you into the other error you ran into in which case you should probably just modify the resulting Makefile directly instead of the Makefile.am/Makefile.in since those trigger the autotools rebuild.