[RDY] Allow building as a static library

The first step to [refactoring Vim into a library](https://github.com/neovim/neovim/wiki/Refactor-vim-into-a-library) is to support compiling it as one.