Bug 672468 - Don't use empty path elements in LD_LIBRARY_PATH
Many of the command line wrappers and perl scripts have their
LD_LIBRARY_PATH and SHLIB_PATH defined with macros that are
replaced by configure. It is common for some of these macros
to be empty, which results in empty path elements.
This patch adds a bit more logic to the creation of the libpath
to avoid empty path elements and leading and trailing colons.