Structurally, it's fine. I'm not sure I get the entire meaning of the sentence. Necessary has me puzzled. Might you mean 'available'? Funds is a plural noun and takes a plural reference ('them' rather than 'it').
If I had the needed funds I could not think of a better place to invest them? or If I had the needed funds I could not have thought of a better place to invest them?