It is actually best to avoid setting this variable if you possibly can.
The binary should have the path to the associated libraries hard-coded into it, eg:
% otool -L /sw/bin/convert
/sw/bin/convert:
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 34.0.0)
/sw/lib/libMagickCore.1.dylib (compatibility version 2.0.0, current version 2.0.0)
/sw/lib/libMagickWand.1.dylib (compatibility version 2.0.0, current version 2.0.0)
/sw/lib/liblcms.1.dylib (compatibility version 2.0.0, current version 2.15.0)
/sw/lib/libtiff.3.dylib (compatibility version 12.0.0, current version 12.2.0)
/sw/lib/libjpeg.62.dylib (compatibility version 63.0.0, current version 63.0.0)
/usr/X11/lib/libfontconfig.1.dylib (compatibility version 5.0.0, current version 5.0.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/sw/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0)
/usr/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/usr/X11/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
/sw/lib/libbz2.1.dylib (compatibility version 1.0.1, current version 1.0.5)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.1)
/sw/lib/freetype219/lib/libfreetype.6.dylib (compatibility version 10.0.0, current version 10.16.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/usr/X11/lib/libSM.6.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/X11/lib/libICE.6.dylib (compatibility version 10.0.0, current version 10.0.0)
/usr/X11/lib/libX11.6.dylib (compatibility version 9.0.0, current version 9.0.0)
/usr/X11/lib/libXau.6.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/X11/lib/libXdmcp.6.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
As long as those libraries are in the correct directories, you don't need to set that variable (which will eventually cause trouble).