First, you would need to compute long term capital gains from old house sale. Below is an indicative computation:
Purchase Year = 1998-99
Purchase Cost = P
Cost Inflation Index (CII) for purchase year = 351
Sale Year = 2011-12
Selling price = 8500000
CII for sale year = 785
Indexed Purchase price = P x (785/351) = R
Long term capital gain = 8500000 - R = S
Income tax on capital gain = S x 20%
As old house was jointly owned, capital gains computed above (S) would be divided among owners (you and your wife) in same ratio as ownership. Assuming 50-50 ownership, each one will have S/2 gain.
As per section 54, To save income tax fully a new house can be purchased or built with cost more than long term gains. If new house is purchased jointly and costs more than S, no income would be payable.
You may even go for buying two houses (one each at your and your wife's name) each costing more than S/2.
Possession and registration of new house should be done in time interval of one year before and two years after sale of old house.
Income tax on capital gains can also be saved by investing into Capital gain bonds under section 54EC. Max investment limit under these are 50 lacs per financial year.