We consider a model of a molecular junction made of BDT (benzene dithiol) molecule trapped between two Au(100) leads. Using the ab initio approach implemented in the SIESTA package we look for the optimal configurations of the molecule as a function of the distance between the leads. We find that for distances long enough the energy of the system is minimized when the molecule is bonded asymmetrically, i.e. chemisorbed to one of the leads, whereas for distances shorter than 12 Å the energy is minimized when the molecule sits in the middle between the leads. We discuss possible consequences of the above findings for the transport properties of the junction.