I just thought about it since European powers were able to endeavor its resources to colonize the new world and establish trade in the East for promise of riches. If they can cross the Atlantic or go past the Cape of Good Hope, they can obviously go reach Mali.
The Portuguese, as well as much of Mediterranean Europe, were certainly aware that much of the gold in circulation as currency in North Africa and Western Europe came from interior West Africa. They did not have quite the detailed knowledge that North African rulers did but in some ways they knew more or had more nuanced knowledge of gold production and trans-Saharan trade in the 1500s than Europeans in 1850 did.
But the question of why they didn't seek it out violently as in the New World presumes something incorrect about Portuguese and then subsequently Dutch, French and English contacts with the Atlantic coast of West Africa, namely that if they knew where gold was being produced that they would invariably seek to claim territorial sovereignty over the sites of gold production and that they were capable of doing so. Neither of those were the case for the late 15th, 16th and 17th Century in West Africa for a variety of reasons.
The states and societies at the Atlantic fringe of the West African world were in many cases quite capable of maintaining substantial military resistance to the Portuguese and other European powers in this era to the point that even if they'd wanted to, they likely couldn't have successfully staged major territorial incursions up the Senegal, Gambia or Niger Rivers or maintained any kind of military authority over those societies. There were some skirmishes and some demonstrations of military power but they didn't amount to much. In many parts of Atlantic Africa, the territory would also have made it very difficult to stage military expeditions or would have required specific knowledge of the major trade routes and the cooperation of local societies (of the kind Cortes had in the Valley of Mexico, for example, from enemies of the Aztec Empire) that would not have been forthcoming. The impact of epidemic diseases in the Americas were also not a factor here--West Africans had more or less the same exposures and immunities and on the other hand West Europeans were extremely vulnerable to diseases like malaria and yellow fever. The question of how Spanish and Portuguese conquerors were able to project military force in the Americas is complicated in its own right, but the same conditions for a variety of reasons really did not pertain in West Africa. Even where the Portuguese did project military force elsewhere on the continent, in Kongo and Angola and in the Zambezi Valley, there were sharp limits on what they were able to do (for example, they were not able to achieve direct territorial control over sites of gold production in interior southern Africa).
Moreover, the Portuguese in the 16th Century were getting everything they wanted from West Africans through coastal trade in a series of ports and outposts, and gold-driven aggression would have in fact badly interrupted much of the commercial activity important to them, which included resupplying ships bound for the Indian Ocean and buying many commodities in addition to gold with high value (and less weight) like kola nut or grains of paradise as well as more quotidian commodities like leather. By the early 17th Century, inflation driven by silver as well as gold was also a serious problem in Spain and to a lesser extent Portugal and to some extent there wasn't much incentive to seek extensive control over yet more sites of silver and gold production as a result. Moreover, by the mid-17th Century, trade in Atlantic Africa was beginning to much more oriented towards slavery, which further dampened any desire for anything like direct military conquest (though not for the use of violence by slave-trading crews).