No, in this case it doesn't matter where you installed them from, what matters is whether you ran ./configure with the option --prefix=/someplace eg
./configure --prefix=/usr # that's what I almost always choose
./configure --prefix=/opt
or somesuch location. If you didn't set --prefix=/wherever then the packages will install in their default location, /usr/local. So when you run the configure script for the next package it will not find the new things you've installed as the first place it will look is in /usr where it will find the versions that were installed with Slack or Mandrake. You need to set some variables to point to the new libraries
Code:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export LDFLAGS="-L/usr/local/lib"
If you're installing these things somewhere else then alter those paths to fit. If you close the shell it will forget and you'll need to enter those variables again the next time you start work.