IK Arm rotates in wrong direction
I would not build the armature this way but anyway, you simply need to bend the arm a bit in Edit mode so that Blender knows the correct orientation (same for the legs).
<img src="https://i.stack.imgur.com/oxQqf.jpg" alt="
" />