I'm on my phone, so the pics are hard to see, but you can try to screw it back into the speedometer. There should be a thread in the back of it that the cable screws on to. I'd suggest using blue loctite when doing this.
lol well it's a good investment, you ought to use it on just about every screw in the bike if you can. You never know when one of them can wiggle free. I've heard of things like that happening from everything from exhausts to license plates.