diff --git a/hw/Makefile b/hw/Makefile
index dc67890e7b4543bf4a76edf7fc9f56c848a9a6aa..6302cd1a003f7e074a9c8cf1d2839b7a5206e6b1 100644
--- a/hw/Makefile
+++ b/hw/Makefile
@@ -46,7 +46,7 @@ top-ice40.json: top-ice40.vl cpu-all.vl reg-file-ice40.vl mem-mux.vl \
 	instr-fetch.vl instr-decode.vl ctz.vl popc.vl srt-reciprocal.vl \
 	cpu.vl \
 	ram-unit.vl avr109rx.vl avr109tx.vl tty-ice40.vl random-bram.hex
-	yosys -q -p 'synth_ice40 -json top-ice40.json' \
+	yosys -q -p 'hierarchy -libdir arith/lib ; synth_ice40 -json top-ice40.json' \
 		-f 'verilog -sv -DICE40 -DRAM_HEX_FILE="random-bram.hex"' \
 		-L top-ice40.stats $<