I would think that this is something that you should "detect" but not "attempt to fix," because now your "fix" is buried where the sysadmin's won't know where to find it. Loader library-paths should be set at only a few well-established places, e.g. profile scripts. An ill-thought-out "workaround," even though it might "make my program work now," might be a big future headache and mask the existence of a root-problem without solving it. Discuss the matter next with your sysadmins and/or management.