dev/ammo suggested:
sed 's#$PREFIX/lib/kde3#$PREFIX/lib/trinity#g'
which I think will work, but I can't figure out how to apply it to configure. We are getting close. Please add thoughts and I'll try again at lunch.
Actually it won't work because configure doesn't contain the entire string $PREFIX/lib/kde3. IIRC the right sed is 's#kde3/plugins#trinity/plugins#g'.