ocamldep will set up the dependencies correctly. For examples, have a look at the multiple Makefile.am files in libguestfs, guestfs-tools & virt-v2v projects. All run as non-root so they don't change anything about "the system" assuming that's what you meant. (On mobile at the moment so can't link easily.)
I don't see how ocamldep is used in there. It seems to use multiple different programming languages somehow. I don't find it easy to understand what it does. It seems to be building a website as well.