terraform them into 80% habitability of your species or gaia.
I almost never terraform.
There are far better ways to deal with habitability. Genetic modification, droids, getting new species in your empire, buildings that increase habitability, strategic resources that increase habitability, techs that increase habitability.
In fact, one of the great advantages to both conquest and migration treaties is gaining POPs that can colonize all types of worlds. Who needs terrarforming?
Habitability: Making Xenos Great, Again. (Even if we oppress them.)
Currently, the only building to affect mineral production is a mineral processing plant.
And the slave processing facility.
And planet modifiers that increase mineral output.
And planet specific edicts that increase mineral output or happiness (which increases output as well).
You pick the right world, and you can turn it into a great source of minerals.
The planet isn't even optimized completely just yet. It still needs some genetic modification, an edict, and it would have been better if it had planet modifiers (but you take what you can get).
EDIT: I forgot to mention that slavery makes habitability mostly moot. As long as a POP can barely tolerate a planet, it can be an efficient slave there.