A weak O2 sensor can cause a CEL code for this. The intake manifold gasket is possible, but I think you would have other symptoms beside just a CEL. If the car idles & runs smooth, an O2 sensor might be going out. Bank 1 is next to the firewall. Harder to reach, but do-able in an hour or so.
P0171 System Too Lean - Bank No. 1.