pole targ it does not work as I would like
There's an option called Pole Angle that can be found just below the boxes where you selected the bones for the constraint. If you adjust the angle, you can get the bones pointing where they should be.

It could be that you have a bone rotated by 90 degrees somewhere, but it's most likely that the constraint is simply using a different axis than you want. Try 90 or -90 degrees to straighten things out. All this option does is take the default orientation that the constraint uses, and offsets it by however many degrees you input (so the limits are 180 and -180).