From what I've read, Lockheed Martin entered a partnership with Yakovlev and essentially funded the last few prototypes after state funding had dried up because of the Soviet Union collapse. Even if they didn't use the exact same engine configuration than the Yak-141 (it's pretty damn close though) I bet those 400 million dollars were well spent to get access to research the Russians had already done in the decade before (even if it just means not repeating the same errors).
F-35 uses totally different configuration and 400 million were for further Yak-141 development which Russians botched anyway.