Senju DNA is always the answer.Actually if I remember right Madara used hand seals to break it....Tobirama had basically broken it using sheer will power alone....until plot contrived Hashirama DNA stopped him lol....I'm guessing he can use hand seals to eliminate the contract.
Sadly I saw this Comming....some excuse that Tobirama wouldn't break free.