are you just starting? in that case , did you use
. ./vars
./clean-all
./build-key
?
the 'clean-all' script removes all key and cert files, but it also creates an empty keys/index.txt and keys/serial file.
You can create them yourself using
touch keys/index.txt
echo 00 > keys/serial