In the meantime, I’ve had similar problems with custom pdf class linking using g++. The way I have gotten around it (inelegantly) is to use a gROOT ProcessLine command in the body of your code (instead of linking).
For example,
gROOT->ProcessLine(".L RooBkgPdf.cxx+");
Some people in Compiling a RooFit User Pdf with g++ seem to have gotten further, but I haven’t managed to re-create their success yet.
good luck, and if you find a simple solution, please share!