C1 = C2 = 2(CL - Cs) where C1 and C2 are the values of capacitors for the Pierce oscillator circuit, CL is the stated load capacitance on the crystal datasheet and Cs, stray capacitance, in a SMT PCB is probably less than 2 pF, if designed correctly with the XTAL close to the pins and C1 and C2 as close also, and an appropriate keep out area and ground plane beneath the Pierce oscillator circuit. On a breadboard, Cs will be a bit higher... This formula is from page 54 of the ATmega328P datasheet. 2(18 - 2) = 32pF. This value can have quite a bit of range, as long as the fuses are set correctly, -U lfuse:w:0xF7:m for the low fuse. Even with a stray capacitance of 5pF, C1 and C2 should be 26pF. I'm not saying that IS the problem, but it could be out of spec. Also, in a custom circuit, consider the application notes, AVR040 and AVR042, to insure the board has appropriate decoupling caps on the power rails and appropriate components to prevent a reset etc.