There is no support for importing IK setups from FBX.
The reason the bones point in weird directions in your screenshot is that Blender only supports bones pointing in a uniform (+Y) orientation, while FBX allows each bone to point in a unique orientation.
There is no way for Blender to represent a bone-orientation per-bone, so there is no way to correctly import/export an FBX with unique bone orientations per bone.
If you turn on the bone-axis display in Blender, and think about which axis the bone should be in your model, you'll see that in your skeleton it's different for each bone. For example, in the UE4 mannequin, one leg's bones should point in +X while the other should point in -X.

If you use Blender FBX Import's "Automatic Bone Orientation", it may fixup each bone individually, and they may look fine in Blender. However, the skeleton is no longer the same as the one in the FBX file, so exported animations will not match up with that original skeleton in UE4.
I know of two ways to deal with this presently.
You can standardize your work on a Blender-compatible skeleton with all bones pointing in +Y direction. The easiest way to do this is to make your original skeleton rig inside Blender, and then export it to the other tools.
You can import your skeleton with "Automatic Bone Orientations", which will effectively make a new skeleton. Then you import that skeleton into UE4, and import all your blender animations into UE4 using this new "+Y bones" skeleton. If you need them on another skeleton, use UE4 retargetting to convert them while inside UE4.
You can read more here..
https://developer.blender.org/T53620#1225926