It is common in cases like this that a portion of the sale proceeds sufficient to cover the lien is placed in escrow at the closing and the deal closes subject to it. When the lien is cleared up post-closing the escrow is released.
Explore your options with your real estate lawyer.
If this answer is helpful, then please mark the helpful button. If this is the best answer, then please indicate it. Thanks. For further information you should see an attorney and discuss the matter completely. If you are in the New York City area, then you can reach me during normal business hours at 718 329 9500 or www.mynewyorkcitylawyer.com.