Cannot install libsodium via commandline
Try installing using homebrew:

brew install libsodium


Homebrew will deal with all the dependencies for you. You can also review the recipe used by homebrew's libsodium.