Constructing bases of finitely presented Lie algebras using Groebner bases in free algebras