fix bug that causes superfluous RPATHs

If no -L is needed to find boost, the script will consider the first path it tries to be the right one, and add a -L for it. This causes a useless RPATH entry, and this in turn causes complaints from package maintainers.