Since Prosody 0.10, this module is included in Prosody, you will be redirected there shortly.
With the plugin installer in Prosody 0.12 you can use:
sudo prosodyctl install --server=https://modules.prosody.im/rocks/ mod_mam
For earlier versions see the documentation for installing 3rd party modules