How to get output linked to input in SPV node?
You can't get a previous transaction via the p2p network based on the txid.

If you use BIP37, fees for received transactions are difficult to calculate in a decentralised way.

Have a look at BIP158 which will probably be available on the network soon.
It has a feature to find the block of your previous txout as well as it doesn't have the privacy problem of BIP37.