Did you #include keyboard.h at the top of your code?
Do you have the library in the directory the compiler is expecting to see it? - look at the error message - it'll tell you where the compiler is looking for the file.
Is the library one that needs to be installed via Sketch/Include Libraries?
The example has been updated prematurely.
Keyboard and Mouse will be separate libraries in IDE version 1.6.6.
Just remove/comment the #includes until 1.6.6 is released (or get an hourly build).