No it is not illegal.  You need to stop and step back for a moment.  You are purchasing the business subject to the lease in palce and I would not purchase it unles sand until you have an agreement in place with the landlord for an extension of the lease agreement.  Please seek legal help asap.  Good luck.