build: Fix dynamic dependency bug

Signed-off-by: Bart Kuivenhoven <bemkuivenhoven@gmail.com>
build: module: Use module flags for dependencies

Signed-off-by: Bart Kuivenhoven <bemkuivenhoven@gmail.com>