How do I avoid tax liability?

 I am 71 self employed. My wife is 70 retired. In 2016 we made a $6500 sep ira contribution in my wife's name. Upon discovering there was no benefit we withdrew the same $6500 from that account 6 days later. I received a 1099-R Showing a $6500 distribution. How do I avoid having this money be taxable income?