*sigh* I love it when docs differ... https://fedoraproject.org/wiki/Packaging:Systemd says `/lib/systemd`, Debian has its stuff in `/lib/systemd`, OpenSUSE in `/usr/lib/systemd`.

May I suggest you add a call to `pkg-config --variable=systemdsystemunitdir systemd` to find out the dir, and only when this fails (because either pkg-config or the systemd.pc is not installed on the system) use one of the choices?