Problem with retargeting BVH bones
First try Makewalk from Makehuman Blender Tools. It works beautifully.
If you didn't skin the rig yet, you can adjust Roll of bones, that tend to rotate wrong. In my case also helped using DAZ friendly BVH instead of Max or Motion Builder friendly ones. If you have problem only with end bones, which are not parents for any other bone effected by the animation, you can also adjust the rotation in Graph Editor by moving all frames of the channel with wrong rotation up or down.
Hope it helps, cause fighting with bvh's can be really annoying.