You have two options:
- Ignore the airwires, perhaps with a note saying that it's intentional - this is not a good design practice.
- Use a different part/device.
Going with the second option. There are a number of approaches you can choose from:
- Use an existing 40-pin pin header from any library. This will work fine in the layout, and allow you to choose the pinout you want. It's perhaps less clear than having a dedicated symbol which names each of the pins.
- Modify the existing library device to add a new package variant. Here you can use the same footprint and symbol you're already using, but simply change the pin mapping to not link the pins you don't want to use.
- Create a new symbol (could copy the old one as a starting point), and add seperate pins in the symbol for each of the power supply pins (e.g. GND_1, GND_2, GND_3, etc). Then create a new device with the existing package and new symbol.
The last option is probably the best. All pins in the footprint now map to a pin in the schematic, so this one gives you full flexibility as to which you connect up. When doing this, I tend to be quite precise in how I name the multiple supply pins. Instead of arbitrarily naming them
GND_2, etc., I tend to name it based on the pin number, so if pin 12 of the header was GND, I'd name that one
GND_12 so you can quickly verify which pins you've left unconnected.