It's easier if you buy a multiple entry visa for Mauritania. You can do that in Rabat. Or, alternatively, get the temporary visa at the Mauritanian border, and then in Nouakchott, at the police station (N 18.0903000 E-15.9709500; coordinates in decimal degrees), ask for a multiple-entry visa.
If you are really interested in getting a single-entry visa for Mauritania, then in Bamako go to the Mauritanian embassy and buy another entry visa. Don't have the coordinates for the embassy, but it is located in a boulevard on the northern bank of the Niger river, on the north-eastern exit of Bamako, along the river bank.