Both Lazarus and FPC uses config files to locate needed files. The trick then is to save these config files inside the Lazarus folder which I assume will be portable, extract the drive + folder name on the host computer when drive is connected, then use this information to locate the config files. The next trick would be to rewrite the folders in the config files so that they expand to include the mounted drive on the host computer.
So my proposal (I haven't tested this) is to use a batch file to launch Lazarus. This batch file (located in the root of the Lazarus folder with lazarus.exe) first extracts its own location using %~dp0, then call the Lazarus executable, passing the path to its config file using the --pcp option:
set lazroot=%~dp0
%lazroot%lazarus.exe --pcp=%lazroot%lazconfigfolder
The fpc.cfg file still needs to be edited to make all paths relatieve to %lazroot%. Also this assumes fpc.cfg is located in the bin folder where the compiler binary is (true for default Lazarus install I think). This assumes the folder structure of a standard Lazarus+FPC install. I'm not sure if there are installed files that end up in the system folder, but I doubt that.
Again, this is just an untested suggestion, corrections & improvements are welcome.