Section 38. If a plaintiff claiming an estate for life only satisfies a judgment upon the defendant's counterclaim for improvements, he or his executor or administrator shall, at the determination of his estate, be paid by the remainderman or reversioner the value of the improvements as they then exist, shall have a lien on the land for said value as if it had been mortgaged for the payment of such value, and may keep possession of the land until such payment is made.