RCG: Fix $bdroot variable replacement for long library references.
Previous code assumed link was top-level, dropping any part of the reference after the second slash. This led to a link to the wrong subsystem.
Improved error message when linked subsystem is not found in library.
Note that the search code doesn't verify the full path of the link. If there were another part of the same name but with different parent subsystems, the RCG would happily link to that instead. This problem is not fixed by this patch.