Just remove the EC_KEY_generate_key function at
line 129 and increment the private key, and then use something like BN_set_word to increment the private key int manually and then run EC_POINT_mul to multiply it by G.
Disclaimer: The linear search will probably be faster, I suspect that the key generation method is slow.