Madagascar prime minister announces resignation