When building Kafka on mac osx, I had no problem. I moved to Ubuntu and received an error:
[info] Compiling main sources...
[error] File name too long
[error] one error found
The problem is that you are most likely on an encrypted filesystem. If you are using Ubuntu, you might not even remember that you selected to have an encrypted filesystem. It presented an option when you installed to encrypt your home directory. You probably answered yes. ;)
Anyway, to get compiling move the source to another filesystem/mount. You'll be good to go after that.