check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when building boot blocks, and it looks like the rest of the code is already using _STANDALONE for this purpose.
- Make this compile in the kernel environment.
"libmd".