I ran onto the same situation several times before, because all my tanks have been bought used or put together from parts.
What I have done is either of two things:
1) Purchase a glass lid (versa-top) that is just a tad shorter, but of the correct width. The width is not critical, because the back of it is always less wide than the tank, and is supplied with it the flexible clear plastic they are sold with, that one cuts notches on to fit HOB filters, etc. Then, I cut two strips of glass that fit at either end of the "inside well" of the top of the tank's frame, from front to back, and silicone them in place. They don't need to be wider than ~1 inch or so, but can be wider (not critical)[If cutting glass is not easy for you, the same can be made with strips of plexiglass, which will not warp because they will rest onto the frame edge on three sides]. Regardless, make sure to sand the sharp edges, for which regular sand paper works well!
Afterwards you can place your glass versa-top, which will rest on the sides onto the strips of glass/plexiglass.
2) Alternatively, cut a single strip of glass (not plexiglass because it will bow), and glue it (or simply put in in) in the middle of the tank's top, resting inside the "inside well". In this case, it would be best it is made ~2-3 inches wide. Afterwards, you can use any glass versa-top that you can get, either a little longer or a little shorter than the tank. No difference. It will rest on the sides of the tank, and onto the strip of glass in the middle.
Either solution works well. It may not be the most elegant (although it is mostly unnoticeable), but it is fully functional.
Good luck!