It will depend on what you have now formated the drive as. Time machine wll not backup to Fat32, ExFAT etc.
To get time machine working again: Open up disc utility, select your drive from the left hand pannel. Click the button which says "Erase" and in the dropdown menu select the "Mac OS Extended (Journaled)" format.
!!-- Please note this will wipe your hard drive. --!!
Finally, Click erase and wait for the drive to reformat.
When it is done open up time machine and it should recognise the drive.
Hope this helps.
James.