Clang Linking error: undefined reference to function calls added by LLVM pass

Hi all,

I have been stuck on this error for long now and I really need help!.

So I am following this tutorial to make a pass that instruments a program by adding calls to an external function (which is logop in rtlib.c). But unlike the tutorial I am trying to instrument a larger code-base which is masstree:

So as instructed for masstree I run ./configure first but then I edit the generated Makefile to use clang (instead of gcc/g++) and run my pass. I also add rtlib.c in the masstree source files so that it gets converted to rtlib.o with the rest of the masstree source files. Here is the relevant part of the modified Makefile with my changes highlighted with an arrow (I also added the $(rtlib) to link it with other .o files to generate executables):