local: Ensure directory for library exists (fixes #703)