Lattice QCD study of the heavy-heavy-light quark potential