You should use "を" instead of "は" in your sentence.
So "レッスンをありがとうございました。" is correct sentence.
We usually put "は" after a noun if it is the subject. But in this case, レッスン is object. So you need to put "を" after the noun.
And sometimes, we omit the particle "を" such as "レッスン、ありがとうございました".
Because we can understand that レッスン is objective in this sentence.