Do you really think that if a world was discovered containing rich amounts of Dilithium would not be approached by the Federation if it was a pre-warp society? H*** no! The Federation would hang the Prime Directive and jump at getting the minerals as soon as possible.
Ask the Halkans.
In 2267, Captain James T. Kirk paid a diplomatic visit to the Halkans, in order to negotiate for the Halkan's abundant supply of Dilithium. But the Halkans refused, due to their totally pacifistic nature. They even reminded Kirk that he had the power to take them forcibly.
And his answer?
"But we won't. Think about that."
To this day, the Halkans are not members of the Federation, and the Federation has not thrown the Prime Directive out the window in order to get the Dilithium.