how to minimize output resistance
Firstly the choice of the flyback diode (presumably a 1N4001 to 1N4007 part). It will adequately catch the back emf of the motor (when the transistor switches off) but it will remain conducting for up to 30 us (supplier dependent) when the transistor reactivates. This means that you will get poor currrent consumption if the PWM frequency is above a few kHz. Use a high speed diode.

Secondly, if the PWM waveform is less than 100% then you won't get full speed compared to connecting the motor directly the battery.

Thirdly, you don't indicate how much base current you are activating the BD139 with. If you want it turn turn on well and saturate you need to be thinking about feeding the base with in excess of 50 mA and your driver may not be able to deliver this. Also, when fed with that current at the base you will get a volt drop from collector to emitter of 0.1 to 0.5 volts with a collector current of only 0.5 amps.

It's not really designed for switching applications and I would recommend you look at using a MOSFET.