To flail means to wave around wildly. If you are stranded on a deserted island and you see a ship in the distance, it’s a good idea to flail your arms in the air to get the captain’s attention.
Flail originates with the Latin word flagellum, which is a whip. It is also related to the noun flail, a stick with a swinging attachment to it, used to thresh grain. As a verb, it most often refers to arms, but can also involve the whole body, especially if someone is a very wild dancer. Other things can flail as well. If someone admits that his business is flailing, it’s probably lacking direction and not doing very well.