In the present paper, two optimal control problems are studied using Lie geometric methods and applying the Pontryagin Maximum Principle at the level of a new working space, called Lie algebroid. It is proved that the framework of a Lie algebroid is more suitable than the cotangent bundle in order to find the optimal solutions of some driftless control affine systems with holonomic distributions. Finally, an economic application is given.