Give it some time! I've had a bunch of chicks like that, that I was SURE would never walk and would have to be culled. I had a quail whose legs went out sideways! I gave them a day or two and they were really wobbly, but every single one of them has straightened out and is fine.
I think some chicks just need time to get those muscles working properly, especially if the chick is weak because of too cool or hot incubation temps or something.
One other idea is to put the chick with a bunch of other chicks. I had a chick who I thought for sure was a goner because she was lying on her back. I kept flipping her over but she kept rolling onto her back. Her legs didn't seem to work. I put her into the brooder with some (slightly) older chicks who promptly started running all over and stepping on her and periodically poking her. Well, she got up really fast! She figured out that she needed to move if she didn't want to be poked and stepped on and once she started using her muscles she got strong quickly. It took about 3 days with her before I was sure she was going to be ok. Now she's a perfectly normal 3 week old chick!
So don't give up! Give it a few days. As long as the chick's not in pain, give him a chance. When you figure how long it takes for a human to learn to use their legs properly, I think a chick deserves a couple of days to get things figured out if they need it!