Replacing LD_LIBRARY_PATH with DYLD_LIBRARY_PATH on mac

On MacOsx DYLD_LIBRARY_PATH is used instead of LD_LIBRARY_PATH. The script checks the OS and use the correct environment variable