You might be able to get it at the border...but you might not be able to...depends on how good your french/bambara/solinke/jahanke is...
But I know you can get it in Morocco(Rabat), Mauritania(Noachutt), or Senegal(Dakar).
I got mine in Rabat in a matter of two hours but I would arrive in the morning first thing...just in case two hours is not sufficient.
250dh or about 30Euro...for one month
If you want specific directions to the embasy in Rabat, bus number, etc...contact me...
Hope that helps.