Currently merlin gets the stdlib path from the compiler that was used to compile merlin itself. This is quite inconvenient because this means that merlin cannot be used with any other compiler (of the same version). In our setting, we use a deploy a precompiled version of merlin in all our developer machines and we used to make this work using an explicit directive in .merlin but this doesn't work anymore with the new .merlin-less plumbing.
Since merlin already queries dune for a bunch of information, why not get the path to the standard library as well from it? You can see the stdlib location that dune uses when you do dune build --verbose.